Skip to content

lure: ensure metadata gaps are filled when generating links#5841

Merged
arthyn merged 4 commits into
developfrom
hm/lure-metadata-gapfill
May 18, 2026
Merged

lure: ensure metadata gaps are filled when generating links#5841
arthyn merged 4 commits into
developfrom
hm/lure-metadata-gapfill

Conversation

@arthyn
Copy link
Copy Markdown
Member

@arthyn arthyn commented May 13, 2026

Summary

%reel had a bug whereby empty nicknames wouldn't fill with any existing group title, minor but still good to fix. The other piece here is making sure we always fill in any gaps in the metadata. %reel has drifted into being more heavily integrated into groups/contacts and this just furthers that by making sure any kind of reel describe calls actually fill in gaps in the metadata from what we have on the backend. This was present in https://github.com/tloncorp/ylem/blob/8af770c82083f1031c84b72a877a7b8ad226c56f/pkg/runtime/pioneer/src/Pioneer/Command/Click.hs#L1537 where we're only giving userId, type, and groupId.

Fixes TLON-5790

Changes

  • %reel-describe gap-filling (desk/app/reel.hoon): when a caller's describe is sparse, backfill missing open-graph fields from server state — invitedGroupTitle / invitedGroupDescription / invitedGroupIconImageUrl scried from %groups, and inviterNickname / inviterAvatarImage read from reel's cached our-profile. Caller-provided values always win; the group scry is wrapped in mole so a missing group doesn't crash the poke.
  • "a Groupchat" fallback fix: the no-nickname branch of the OG-title formula was hard-coding "You're Invited to a Groupchat" even when the group had a real title. It now uses group-title (which itself still falls back to "a Groupchat" when the title is empty).
  • group-og-title helper: extracted the formula shared by the /contacts and /groups subscription handlers into a single helper in the upper |% core. No behavior change.
  • Tests (desk/tests/app/reel.hoon): added a scry mock returning an empty group:v9:gv for the gap-fill path, wired it into the three tests that exercise %reel-describe (test-reel-describe, test-groups-update, test-contacts-update). Updated the test-groups-update $og_title expectation to reflect the corrected fallback ("You're Invited to Early Sunrise" instead of "…a Groupchat").

How did I test?

Ran ./backend/run-tests.sh locally against a moon— all three reel tests pass (test-reel-describe, test-groups-update, test-contacts-update). No e2e or client changes

Risks and impact

  • Safe to rollback without consulting PR author? Yes
  • Affects important code area:
    • Onboarding
    • State / providers
    • Message sync
    • Channel display
    • Notifications
    • Other: lure / invite-link metadata (%reel agent)

Rollback plan

Revert the merge commit. The agent state-version is unchanged, so no migration concerns. Any lures registered while this is live keep their backfilled metadata fields, which is forward-compatible with the prior code path (extra fields are just ignored downstream if reverted).

Screenshots / videos

N/A — backend / Hoon only. The user-visible effect is open-graph previews on shared invite links: titles like "Tlon Messenger: You're Invited to <Group Title>" instead of "…to a Groupchat" when the inviter has no nickname yet.

arthyn and others added 2 commits May 13, 2026 16:10
Two related fixes to lure open-graph metadata.

%reel-describe now backfills missing fields from server state when
the caller's describe is sparse: title/description/image scried from
%groups, and nickname/avatar from our cached profile. Caller-provided
values always win, and scry failures are tolerated via mole. This
lets pioneer create lures with a bare describe and still get a fully
populated preview, instead of relying on later subscription updates.

The "a Groupchat" fallback in the og-title formula was unconditional
in the no-nickname branch, ignoring a real group title when one was
present. It now uses group-title (which itself still falls back to
"a Groupchat" when the title is empty), so a titled group renders
"You're Invited to <Title>" instead of "You're Invited to a Groupchat".

Tests gain a scry mock returning an empty group:v9:gv for the gap-fill
path, and the test-groups-update expectation is updated to reflect
the corrected fallback behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Two call sites in the /contacts and /groups subscription handlers
were computing the same group-invite open-graph title. Extracted
the formula (including the "a Groupchat" fallback) into a single
helper in the upper |% core.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@arthyn arthyn requested review from Fang- and mikolajpp May 13, 2026 21:28
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@linear
Copy link
Copy Markdown

linear Bot commented May 14, 2026

TLON-5790

Copy link
Copy Markdown
Member

@Fang- Fang- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some safety concerns for the stuff you tried making safe. Looks good otherwise!

Comment thread desk/app/reel.hoon Outdated
Comment thread desk/app/reel.hoon Outdated
Copy link
Copy Markdown
Collaborator

@mikolajpp mikolajpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, the logic is sound.
A few coding nits, but that's about it!

Comment thread desk/app/reel.hoon Outdated
Comment thread desk/app/reel.hoon
Comment thread desk/app/reel.hoon Outdated
Comment thread desk/app/reel.hoon Outdated
Comment thread desk/app/reel.hoon Outdated
Comment thread desk/app/reel.hoon Outdated
Comment thread desk/app/reel.hoon Outdated
Comment thread desk/tests/app/reel.hoon Outdated
Copy link
Copy Markdown
Member

@Fang- Fang- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, thank you. Concur with @mikolajpp's comments.

Rename helpers (blank -> is-blank, gt -> title, gmeta -> meta, fld ->
fields), tighten is-blank's key to field:reel, and switch the gap-fill
block to =* aliasing so is-blank re-evaluates against the current
fields binding.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@arthyn arthyn merged commit 292eb4f into develop May 18, 2026
4 checks passed
@arthyn arthyn deleted the hm/lure-metadata-gapfill branch May 18, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants